<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/2/27 0027
  Time: 15:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!-- 表单验证 -->
<script type="text/javascript" src="${requestScope.webRoot}static/js/jquery/jquery.form.js"></script>
<link rel="stylesheet" href="${requestScope.webRoot}static/bootstrap/validator/bootstrapValidator.min.css">
<script src="${requestScope.webRoot}static/bootstrap/validator/bootstrapValidator.min.js"></script>

<div class="modal fade modalPanel" tabindex="-1" id="foodsModal">
    <div class="modal-dialog" style="width: 400px;">
        <div class="modal-content">
            <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post">
                <div class="form-group">
                    <label class="col-sm-3 control-label">图片:</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="file" name="picurl" style="display:none;"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">类型:</label>
                    <div class="col-sm-9">
                        <select class="form-control" name="typeid"></select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">名称:</label>
                    <div class="col-sm-9">
                        <input class="form-control" name="foodName" type="text" placeholder=""/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">价格:</label>
                    <div class="col-sm-9">
                        <input class="form-control" name="foodPrice" type="text" placeholder=""/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">内部价格:</label>
                    <div class="col-sm-9">
                        <input class="form-control" name="foodVip" type="text" placeholder=""/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">介绍:</label>
                    <div class="col-sm-9">
                        <input class="form-control" name="feature" type="text" placeholder=""/>
                    </div>
                </div>
                <div class="form-group">
                    <div>
                        <button class="back col-sm-4 col-sm-offset-2 col-xs-4 col-xs-offset-2  btn btn-default" type="button" >返回</button>
                        <button class="submit col-sm-4 col-sm-offset-1 col-xs-4 col-xs-offset-1 btn btn-primary" type="button" >提交</button>
                    </div>
                </div>
                <input type="hidden" name="fid">
                <%--<input type="hidden" name="userId" value="${sessionScope.user.id}">--%>
            </form>
        </div>
    </div>
</div>
<script src="${requestScope.webRoot}static/js/control/select/Select.js"></script>
<script src="${requestScope.webRoot}static/js/control/img/selectImage.js"></script>
<script src="${requestScope.webRoot}static/js/control/form/BootstrapValidateBaseForm.js"></script>
<script src="${requestScope.webRoot}static/js/control/form/FoodsForm.js"></script>
<script>
    $(function () {
        tableObject.foodsForm = new FoodsForm({
            $modal:$("#foodsModal"),
            $error:$("#error"),
            table:tableObject
        });

        /* 图片选择框 */
        $("[name='picurl']").selectImage();

        /* select标签 */
        Select.injectData($("[name='typeid']"),foodTypeSelect, "typeid", "typename",null, 0);

    });
</script>
